local function main (userOb, msgData)
     local equip = EQUIP_D:get_equip_by_pos(userOb, msgData.pos)
     if not equip then
          local result = {}
          result.code = 400
          userOb:send_packet("MSGS2CEquipUp", result)
          return
     end

     local use_yuanbao = equip.useYuanbao
     if not use_yuanbao then
          local result = {}
         result.code = 401
         userOb:send_packet("MSGS2CEquipUp", result)
         return
     end

     local own_yuanbao = userOb:get_currency(GamePropIds.kGamePropIdsDiamondsIcon)
     if own_yuanbao < use_yuanbao then
          local result = {}
         result.code = 402
         userOb:send_packet("MSGS2CEquipUp", result)
         return
     end

     ---! 扣除钻石
     INVENTORY_D:cost_currency(userOb, GamePropIds.kGamePropIdsDiamondsIcon, use_yuanbao)

     ---! 升级装备
     EQUIP_D:level_up(equip)

     local result = {}
     result.code = 200
     result.id =  equip.id
     result.level = equip.level
     userOb:send_packet("MSGS2CEquipUp", result)
     ITEM_D:send_currency_info(userOb)

     ---! 同步翅膀排名
     RANK_D:sync_rank_data(userOb, "equip_rank")
end

--注册方法
COMMAND_D:register_command("MSGC2SEquipUp",GameCmdType.NONE, main)
